namespace KMS.Core
{
    using System;

    [Serializable]
    internal class PropertyInfoProvider<TTarget, TProperty> : PropertyAccessorImp
    {
        private readonly Func<TTarget, TProperty> getter;
        public PropertyInfoProvider(Func<TTarget, TProperty> getter)
        {
            this.getter = getter;
        }
        public override object GetValue(object obj)
        {
            return this.getter((TTarget)obj);
        }
    }
}